package lt.marsrutai.mobile.android.map.overlay;

import android.content.Context;
import android.util.AttributeSet;

/**
 * Displays a balloon overlay item which can be clicked
 * 
 * @author Justas
 */
public class ClickableBalloonView extends BalloonView<ClickableOverlayItem> {
    
    public ClickableBalloonView(Context context) {
        super(context);
    }
    
    public ClickableBalloonView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    protected void init(Context context) {
        super.init(context);
        layout.setClickable(true);
    }
    
    public void setData(ClickableOverlayItem item) {
        super.setData(item);

        if (item.getOnClickListener() != null) {
            layout.setOnClickListener(item.getOnClickListener());
        }
    }
}
